$OpenBSD: patch-lib_Makefile_in,v 1.3 2013/10/10 07:02:56 jasper Exp $

Enable shared library, from pkgsrc.

--- lib/Makefile.in.orig	Sun Dec 15 19:02:30 2002
+++ lib/Makefile.in	Thu Oct 10 08:59:32 2013
@@ -69,13 +69,15 @@ all: ${ALL}
 .PHONY: clean distclean install
 
 libtar.a: ${LIBTAR_OBJS} ${LIBOBJS}
-	${AR} rc libtar.a ${LIBTAR_OBJS} ${LIBOBJS}
-	${RANLIB} libtar.a
+	${LIBTOOL} --mode=link --tag=CC \
+		${CC} -o libtar.la ${LIBTAR_OBJS:.o=.lo} ${LIBOBJS:.o=.lo} \
+		${LDFLAGS} -rpath ${TRUEPREFIX}/lib -version-info 1:2
 
 ${LIBTAR_OBJS}: ${LIBTAR_HDRS}
 
 .c.o:
-	${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<
+	${LIBTOOL} --mode=compile --tag=CC \
+		${CC} ${CFLAGS} ${CPPFLAGS} -c -o ${@:.o=.lo} $< -prefer-pic
 
 clean:
 	rm -f *~ *.o ${ALL} core
@@ -85,7 +87,8 @@ distclean: clean
 
 install: ${ALL}
 	${MKDIR} ${DESTDIR}${libdir}
-	${INSTALL_DATA} libtar.a ${DESTDIR}${libdir}
+	${LIBTOOL} --mode=install \
+		${INSTALL_DATA} libtar.la ${DESTDIR}${libdir}
 	${MKDIR} ${DESTDIR}${includedir}
 	${INSTALL_DATA} ${srcdir}/libtar.h ${DESTDIR}${includedir}
 	${INSTALL_DATA} ../listhash/libtar_listhash.h ${DESTDIR}${includedir}
